﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ZzgkChatRoom.View;
using ZzgkChatRoom.ViewModels;

namespace ZzgkChatRoom
{
    /// <summary>
    /// ChatWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        
       // ChatWindowViewModel viewModel;
        MainWindowViewModel viewModel;
        double x;
        public MainWindow()
        {
            x = SystemParameters.WorkArea.Width * 0.6;
            double y = SystemParameters.WorkArea.Height * 0.7;
            viewModel = new MainWindowViewModel();
            DataContext = viewModel;
            viewModel.SetWH(x, y);
            InitializeComponent();
        }

        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                this.DragMove();
            }
        }

     
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ChatPage chatPage = new ChatPage(x);
            framePage.Navigate(chatPage);
        }
    }
}
